define(function (require) {
var zsApp = require('app');
zsApp.controller( 'rolebyUserController',["$scope","$http","$state","$stateParams","$window","$timeout","$rootScope","$cookieStore", function($scope,$http,$state,$stateParams,$window,$timeout,$rootScope,$cookieStore){
		//ID
		$scope.userId = [];
		// 用户分页
		$rootScope.paginationConfuser = {
	        currentPage: 1,
	        totalItems: 100,
	        itemsPerPage: 10,
	        pagesLength: 3,
	        perPageOptions: [10, 20, 30, 40, 50],
	        onChange: function(){
	        	var self = this;
					$http({
						url    : $scope.zsUrl+'digitalhome-boss/admin/roles/getleftUserList',
						method : 'POST',
						data   : {
							pageNumber	:	self.currentPage,
							pageSize  	:	self.itemsPerPage,
							queryType   :  	0,								
						},
					}).then(function success(res) {
							//console.log(res.data.result);
							// 角色组列表页面表格
							$scope.user_tabVal = res.data.result;
							
							$cookieStore.put('userListcookie',$scope.user_tabVal);
							// 遍历所有角色ID
							angular.forEach(res.data.result, function(obj, i) {
								$scope.userId[i] = obj.userId;
							});	
							
							// 总共有多少条数据
							self.totalItems = res.data.length;

						}, 
						function error(err) {
							console.log(err);
						}
					);
				}
	        }

	    
   		        
}])
})